package com.imooc.demo.controller;

import com.imooc.demo.configuration.StudentConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {
    @Autowired
    private StudentConfiguration studentConfiguration;

    @RequestMapping("/")
    public String hello() {
        return "Hello World!";
    }

    @RequestMapping("/student")
    public String student() {
        return studentConfiguration.getName() + "-" + studentConfiguration.getAge();
    }
}
